<template>
	<view class="layout">
		<view class="navbar">
			<view class="statusbar" :style="{ height: getStatusBarHeight() + 'px' }">
				
			</view>
			<view class="titlebar" :style="{ height: getTitleBarHeight() + 'px', marginLeft: getLeftIconLeft() + 'px' }">
				<view class="title">
					{{title}}
				</view>
				<navigator url="/pages/search/search" class="search">
					<uni-icons class="icon" type="search" size="18" color="#888"></uni-icons>
					<text class="text">搜索</text>
				</navigator>
			</view>
		</view>
		<view class="fill" :style="{ height: getNavBarHeight() + 'px' }">
			
		</view>
	</view>
</template>

<script setup>
import { getStatusBarHeight, getTitleBarHeight, getNavBarHeight, getLeftIconLeft } from "@/utils/system.js"
defineProps({
	title: {
		type: String,
		default: "壁纸"
	}
})
</script>

<style lang="scss" scoped>
.layout {
	.navbar {
		width: 100%;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;
		// 从上到下渐变   从透明到白色    高度到400rpx之后都为白色,即从0到400rpx之间渐变
		// 从左到右渐变   从#beecd8到#F4E2D8    前20%为 #beecd8颜色,即从20%之后开始渐变
		background: 
		linear-gradient(to bottom, transparent, #fff 400rpx),
		linear-gradient(to right, #beecd8 20%, #F4E2D8);
		.statusbar {
		}
		.titlebar {
			display: flex;
			align-items: center;
			padding: 0 30rpx;
			.title {
				font-size: 50rpx;
				font-weight: 700;
				color: $text-font-color-1;
			}
			.search {
				width: 240rpx;
				height: 50rpx;
				display: flex;
				align-items: center;
				border: 1px solid #fff;
				background-color: rgba(255, 255, 255, 0.4);
				border-radius: 25rpx;
				font-size: 28rpx;
				margin-left: 30rpx;
				color: #999;
				.icon {
					margin-left: 5rpx;
				}
				.text {
					margin-left: 5rpx;
				}
			}
		}
	}
}
</style>